package com.hpeng.sys.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "CATEGORYS")
public class Category implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private String catid;			//物品类别编号
	private String catname;			//物品类别名称
	private String catsimplename;	//物品类别简称
	private String catalias;		//物品类别别名
	private String catnorms;		//物品规格
	private String catunit;			//物品单位
	private String catlowstock;		//最低库存数量
	private String cathighstock;	//最高库存数量
	private String catactualstock;	//实际库存数量
	private String catinusecount;	//实际库存数量
	private Set<AssetCard> assetCards = new HashSet<AssetCard>(0);

	public Category() {
	}
	
	@Id
	@Column(name = "CATID")
	public String getCatid() {
		return this.catid;
	}

	public void setCatid(String catid) {
		this.catid = catid;
	}

//资产类型与资产卡片的关系
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "category")
	public Set<AssetCard> getAssetCards() {
		return this.assetCards;
	}

	public void setAssetCards(Set<AssetCard> assetCards) {
		this.assetCards = assetCards;
	}


	@Column(name = "CATNAME", length = 200)
	public String getCatname() {
		return this.catname;
	}

	public void setCatname(String catname) {
		this.catname = catname;
	}

	@Column(name = "CATSIMPLENAME", length = 100)
	public String getCatsimplename() {
		return this.catsimplename;
	}

	public void setCatsimplename(String catsimplename) {
		this.catsimplename = catsimplename;
	}

	@Column(name = "CATALIAS", length = 100)
	public String getCatalias() {
		return this.catalias;
	}

	public void setCatalias(String catalias) {
		this.catalias = catalias;
	}

	@Column(name = "CATNORMS", length = 100)
	public String getCatnorms() {
		return this.catnorms;
	}

	public void setCatnorms(String catnorms) {
		this.catnorms = catnorms;
	}

	@Column(name = "CATUNIT", length = 100)
	public String getCatunit() {
		return this.catunit;
	}

	public void setCatunit(String catunit) {
		this.catunit = catunit;
	}

	@Column(name = "CATLOWSTOCK")
	public String getCatlowstock() {
		return this.catlowstock;
	}

	public void setCatlowstock(String catlowstock) {
		this.catlowstock = catlowstock;
	}

	@Column(name = "CATHIGHSTOCK")
	public String getCathighstock() {
		return this.cathighstock;
	}

	public void setCathighstock(String cathighstock) {
		this.cathighstock = cathighstock;
	}
	
	/*
	 * 	根据资产卡片数量统计出来的数据  当入库一个资产时加1 当出库一个资产时减1
	 */
	@Column(name = "CATACTUALSTOCK")
	public String getCatactualstock() {
		return this.catactualstock;
	}

	public void setCatactualstock(String catactualstock) {
		this.catactualstock = catactualstock;
	}
	@Column(name = "CATINUSECOUNT")	
	public String getCatinusecount() {
		return catinusecount;
	}
	
	public void setCatinusecount(String catinusecount) {
		this.catinusecount = catinusecount;
	}
}